package windowUnits;

import java.awt.Insets;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.SwingConstants;

import windows.NewArticle;

import com.swtdesigner.SwingResourceManager;

public class ActionButton extends JButton {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	String buttonText = null;
	String buttonIcon = null;
	
	
	public ActionButton(String text,String icon) {
		this(SwingResourceManager.getIcon(NewArticle.class, "/icons/"+icon));
		buttonText = text;
		buttonIcon = icon;
	}
	
	public ActionButton(ImageIcon ic){
		setVerticalTextPosition(SwingConstants.BOTTOM);
		setHorizontalTextPosition(SwingConstants.CENTER);
		setHorizontalAlignment(SwingConstants.LEFT);
		setMargin(new Insets(2, 2, 2, 2));
		setIcon(ic);
		setText(buttonText);
	}
	
}
